home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000066_icon-group-sender_Fri Mar 28 16:48:55 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  5KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2SNmjI02806
  4.     for icon-group-addresses; Fri, 28 Mar 2003 16:48:45 -0700 (MST)
  5. Message-Id: <200303282348.h2SNmjI02806@baskerville.CS.Arizona.EDU>
  6. From: voice_of_reason@australia.edu (Quiet Voice)
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: Befuddled by logic and an error message.....
  9. Date: 28 Mar 2003 11:31:13 -0800
  10. X-Complaints-To: groups-abuse@google.com
  11. To: icon-group@cs.arizona.edu
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. Once again following up my own follow-up....
  16.  
  17. Thank you to all for the email responses.
  18.  
  19. As it turns out, I have solved my problem...at least this one.
  20.  
  21. I'm still not certain what was causing the error, but I suspected it
  22. revolved around reading from and writing to the same file. So I
  23. developed a work-around by creating *TWO* temp files to hold the
  24. editing: one for reading from and one for writing two. For each pass
  25. thru the editing loop, the program swaps which is the read and which
  26. is the write file. So the editing updates that you write to one file
  27. are then read out during the next pass and written to the other file
  28. (along with the newest updates). Back and forth...etc etc.
  29.  
  30. Its a bit of a kludge.....but it works!
  31.  
  32. Again, thanks!
  33.  
  34.  
  35.  
  36. voice_of_reason@australia.edu (Quiet Voice) wrote in message news:<9428c6a7.0303280746.51de65da@posting.google.com>...
  37. > A follow-up to my own post based on some e:mail I recieved....
  38. > >Are you running on Windows or UNIX...on NT4SP6a with
  39. > >Icon 9.3.2 I get this:
  40. > >
  41. > >Run-time error 214
  42. > >File io.icn; Line 4
  43. > >input/output error
  44. > >offending value: 68
  45. > >Traceback:
  46. > >   main()
  47. > >   write(file(x),68) from line 4 in io.icn
  48. > >
  49. > I am running under Win 2000 with version 9.3.2.....and that is
  50. > precisely the error message I get.
  51. > >
  52. > >But I've got a broader question: Why is the temp file necessary?  
  53. > I use the temp file because the editting process is iterative. 
  54. > What I mean is that the program reads in the original file, writes it
  55. > over to a temporary holding file and offers the user a chance to edit
  56. > the file, observe the results and re-edit...over and over...until he
  57. > is satisfied. Each time, the program outputs the original file along
  58. > side the most recent edits.
  59. > Once satisfied, the program writes out the final version of the temp
  60. > file as the "answer".
  61. > voice_of_reason@australia.edu (Quiet Voice) wrote in message news:<9428c6a7.0303271418.6dd64a38@posting.google.com>...
  62. > > Greetings:
  63. > > 
  64. > > Still in my endeavor to "re-learn" ICON, I have hit upon a bug that is
  65. > > partially a logic bug and partially a runtime error.
  66. > > 
  67. > > What I am attempting to do is as follows --
  68. > > 
  69. > > A file is opened which contains text.
  70. > > 
  71. > > The idea of the program is to allow the user to selectively and
  72. > > iteratively edit and re-edit the file and see the edits alongside the
  73. > > original version of text.
  74. > > 
  75. > > The program creates and output file that holds the original text and
  76. > > the current state of editing.
  77. > > 
  78. > > A line from the original file along with the corresponding edited line
  79. > > are written to output.
  80. > > 
  81. > > With each pass thru the loop the idea is that the program opens a temp
  82. > > file that holds the current editing. The user is essentially
  83. > > iteratively editing the temp file.
  84. > > 
  85. > > Here's the code fragment along with comments I've written to
  86. > > myself....
  87. > > 
  88. > > target := current text
  89. > > edit := proposed edits
  90. > >   .
  91. > >   .
  92. > >   .
  93. > > 
  94. > > # LOGIC PROBLEM WITH THIS LOOP. NEED TO READ DATA FROM CURRENT GUESS
  95. > > *THEN* SAVE NEW GUESS FOR
  96. > > # FUTURE READ....but NEED TO PREVENT "INFINTIE LOOP" SITUATION OF
  97. > > READING THEN WRITING THEN READING>>>>ETC
  98. > > 
  99. > > # CURRENT VERSION RESULTS IN RUN-TIME ERROR: 214 (???) in line 88
  100. > > 
  101. > > while (line := read(temp_holder)) do
  102. > >               {
  103. > >            orig := read(orig_text)
  104. > >                trial_line := map(line,target,edit)
  105. > > 
  106. > >                write(output,"original: ",orig)
  107. > >                write(output," ")
  108. > >                write(output,"new:      ",trial_line)
  109. > >                write(output," ")
  110. > > 
  111. > > OFFENDING LINE OF CODE  ==> write(temp_holder,trial_line)   # save
  112. > > current trial set
  113. > >                 }
  114. > > 
  115. > > write("TRIAL CORRECTIONS WRITTEN TO TEMPORARY FILE.")
  116. > > writes("Do you have more corrections? Type yes or no: ")
  117. > > more := read()
  118. > > 
  119. > > } #end INPUT loop
  120. > > 
  121. > > 
  122. > > ---
  123. > > First of all, what sort of situations create a runtime error 214? What
  124. > > am I doing wrong?
  125. > > 
  126. > > Secondly, any suggestions on how better to accomplish this?
  127. > > 
  128. > > Thanks for the advice and assitance.....
  129.